package top.tagao.m01_structuralPatterns.s_06_decorator;

/**
 * @author fu-xiao-liu
 * @Date 2022/8/1 23:40
 */
public class Decorator extends Drink{

    Drink drink;

    public Decorator(Drink drink) {
        this.drink = drink;
    }

    @Override
    public String getDes() {
        //描述等于    装饰者  +    被装饰者
        return super.getDes()+ " " + drink.getDes();
    }

    @Override
    public float cost() {
        //花费等于     装饰者  +    被装饰者
        return super.getPrice() + drink.cost();
    }


}
